<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>ArNetworking: getVideoExample.cpp</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ArNetworking
   &#160;<span id="projectnumber">dev20161014</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('getVideoExample_8cpp-example.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">getVideoExample.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<p>This example client requests video images from the server and saves them repeatedly to a file named "video.jpg", or to a series of files ("video1.jpg", "video2.jpg", etc.) if you give the -counter option. Give the image request rate in images per second with the -rate option (or use -1 to let the server decide when to send image; may not work with all servers).</p>
<p>Connect to SAVserver, ACTS, or another video server to get images.</p>
<p>To make a movie from the images, you can use ffmpeg on Linux. First run with frame rate and counter options to save multiple images: ./getVideoExample -host robothost -port 7272 -rate 20 -counter Then use ffmpeg: ffmpeg -i videod.jpeg -r 20 movie.mpeg See ffmpeg -h for full list of options.</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;Aria.h&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="ArNetworking_8h.html">ArNetworking.h</a>&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">bool</span> <a name="a0"></a><a class="code" href="getVideoExample_8cpp.html#ab2fdc0f1bbbd46b714580926f62fae6e">useCounter</a> = <span class="keyword">false</span>;</div><div class="line"><span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a name="a1"></a><a class="code" href="getVideoExample_8cpp.html#a2c605870a4e5975004e2e04a9a033d35">counter</a> = 1;</div><div class="line"></div><div class="line"><span class="keywordtype">double</span> <a name="a2"></a><a class="code" href="getVideoExample_8cpp.html#a40fc078492fcc08ce7ad3957496b4c0b">rate</a> = 0;</div><div class="line"><span class="keywordtype">int</span> <a name="a3"></a><a class="code" href="getVideoExample_8cpp.html#ad9766129714f3e0c883bbb9879c85be4">rateAsTime</a> = 0;</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> <a name="a4"></a><a class="code" href="getVideoExample_8cpp.html#ab990e842f67b35df051fd7edddd35888">jpegHandler</a>(<a name="_a5"></a><a class="code" href="classArNetPacket.html">ArNetPacket</a> *packet)</div><div class="line">{</div><div class="line">  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width;</div><div class="line">  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height;</div><div class="line">  <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> jpeg[50000];</div><div class="line">  <span class="keywordtype">int</span> jpegSize;</div><div class="line">  FILE *<a name="a6"></a><a class="code" href="configClientToServer_8cpp.html#adf16cd437526a5c5e0e0af87745acbb8">file</a>;</div><div class="line"></div><div class="line">  width = packet-&gt;<a name="a7"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArBasePacket.html#ac2d63293b9a983d18430eceb0edbf0b1">bufToUByte2</a>();</div><div class="line">  height = packet-&gt;<a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArBasePacket.html#ac2d63293b9a983d18430eceb0edbf0b1">bufToUByte2</a>();</div><div class="line">  jpegSize = packet-&gt;<a name="a8"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArBasePacket.html#adc317a80a2a2ed97529455016b615c88">getDataLength</a>() - packet-&gt;<a name="a9"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArBasePacket.html#a9f2cace3e90269774854a24c04cf20ef">getDataReadLength</a>();</div><div class="line">  <span class="keywordflow">if</span>(jpegSize &gt; 50000)</div><div class="line">  {</div><div class="line">    <a name="a10"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a name="a11"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;Cannot save image, it&#39;s too big. (image is %d bytes, my buffer is 50000 bytes)&quot;</span>, jpegSize);</div><div class="line">    <span class="keywordflow">return</span>;</div><div class="line">  }</div><div class="line">  packet-&gt;<a name="a12"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArBasePacket.html#ab36d3542331e2e288747cbcc0d36333e">bufToData</a>((<span class="keywordtype">char</span> *)jpeg, jpegSize);</div><div class="line">  <span class="keywordtype">char</span> filename[128];</div><div class="line">  <span class="keywordtype">char</span> tmpFilename[128];</div><div class="line">  sprintf(tmpFilename, <span class="stringliteral">&quot;tmp.jpg&quot;</span>);</div><div class="line">  <span class="keywordflow">if</span> ((file = <a name="a13"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArUtil.html#a0c4d240777628983e66005d7f7a4939c">ArUtil::fopen</a>(tmpFilename, <span class="stringliteral">&quot;wb&quot;</span>)) != NULL)</div><div class="line">  {</div><div class="line">    fwrite(jpeg, jpegSize, 1, file);</div><div class="line">    fclose(file);</div><div class="line">    <span class="keywordflow">if</span>(<a class="code" href="getVideoExample_8cpp.html#ab2fdc0f1bbbd46b714580926f62fae6e">useCounter</a>)</div><div class="line">      snprintf(filename, 64, <span class="stringliteral">&quot;video%lu.jpg&quot;</span>, <a class="code" href="getVideoExample_8cpp.html#a2c605870a4e5975004e2e04a9a033d35">counter</a>++);</div><div class="line">    <span class="keywordflow">else</span></div><div class="line">      strcpy(filename, <span class="stringliteral">&quot;video.jpg&quot;</span>);</div><div class="line"><span class="preprocessor">#ifdef WIN32</span></div><div class="line">    <span class="comment">// On windows, rename() fails if the new file already exists</span></div><div class="line">    unlink(filename);</div><div class="line"><span class="preprocessor">#endif</span></div><div class="line">    <span class="keywordflow">if</span> (rename(tmpFilename, filename) == 0)</div><div class="line">      <a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;Wrote a %dx%d image, %d bytes, named %s.&quot;</span>, width, height, jpegSize, filename);</div><div class="line">    <span class="keywordflow">else</span></div><div class="line">      <a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;Wrote a %dx%d image, %d bytes, named %s (could not rename to real name).&quot;</span>, width, height, jpegSize, tmpFilename);</div><div class="line">  }</div><div class="line">  <span class="keywordflow">else</span></div><div class="line">    <a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;Could not write temp file %s&quot;</span>, tmpFilename);</div><div class="line"></div><div class="line">  <span class="keywordflow">if</span> (<a class="code" href="getVideoExample_8cpp.html#a40fc078492fcc08ce7ad3957496b4c0b">rate</a> == 0 || <a class="code" href="getVideoExample_8cpp.html#ad9766129714f3e0c883bbb9879c85be4">rateAsTime</a> == 0)</div><div class="line">  {</div><div class="line">    <a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;Only one frame was requested, so exiting&quot;</span>);</div><div class="line">    <a name="a14"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classAria.html#a6abc3d39b3e9548063bb8e78375acc17">Aria::exit</a>(0);</div><div class="line">  }</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> <a name="a15"></a><a class="code" href="getVideoExample_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv)</div><div class="line">{</div><div class="line"></div><div class="line"><span class="preprocessor">#ifndef WIN32</span></div><div class="line">  <a name="_a16"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArDaemonizer.html">ArDaemonizer</a> daemonizer(&amp;argc, argv, <span class="keyword">false</span>);</div><div class="line">  <span class="keywordtype">bool</span> isDaemonized = <span class="keyword">false</span>;</div><div class="line">  <span class="keywordflow">if</span> (!daemonizer.<a name="a17"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArDaemonizer.html#adcaf687f2c468a61f54637c08cec7bfc">daemonize</a>())</div><div class="line">  {</div><div class="line">    <a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a name="a18"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a012daf6573594f91242f8dd7c02eb74b">ArLog::Terse</a>, <span class="stringliteral">&quot;Could not daemonize process&quot;</span>);</div><div class="line">    exit(1);</div><div class="line">  }</div><div class="line">  <span class="keywordflow">if</span> (daemonizer.<a name="a19"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArDaemonizer.html#a19812903293026e2a654b4c5526b939f">isDaemonized</a>())</div><div class="line">    isDaemonized = <span class="keyword">true</span>;</div><div class="line"><span class="preprocessor">#endif</span></div><div class="line"></div><div class="line">  <a name="a20"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classAria.html#ad99c16b5d947229d9f8e1c5b2d4cdd73">Aria::init</a>();</div><div class="line">  <a name="a21"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#a74fa320b89ec1ece70053722c91f7c71">ArLog::init</a>(<a name="a22"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#aa62617e816d9caa5853bf4ce9b34ca10a35b2c9a3d5c6bb0f2dbe2064cc0163db">ArLog::File</a>, <a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;getVideoLog.txt&quot;</span>, <span class="keyword">true</span>, <span class="keyword">true</span>, <span class="keyword">true</span>);</div><div class="line">  </div><div class="line">  <a name="_a23"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArArgumentParser.html">ArArgumentParser</a> argParser(&amp;argc, argv);</div><div class="line">  argParser.<a name="a24"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArArgumentParser.html#a501694b62a7f8b0c3cadd84aeafe1b35">loadDefaultArguments</a>();</div><div class="line"></div><div class="line">  <a name="_a25"></a><a class="code" href="classArClientSimpleConnector.html">ArClientSimpleConnector</a> clientConnector(&amp;argParser);</div><div class="line"></div><div class="line">  <span class="keywordflow">if</span>(argParser.<a name="a26"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArArgumentParser.html#ae2d26852c3f2eb5306c4a88c240109f9">checkParameterArgumentDouble</a>(<span class="stringliteral">&quot;-rate&quot;</span>, &amp;<a class="code" href="getVideoExample_8cpp.html#a40fc078492fcc08ce7ad3957496b4c0b">rate</a>) &amp;&amp; <a class="code" href="getVideoExample_8cpp.html#a40fc078492fcc08ce7ad3957496b4c0b">rate</a> != 0.0)</div><div class="line">  {</div><div class="line">    <span class="keywordflow">if</span>(<a class="code" href="getVideoExample_8cpp.html#a40fc078492fcc08ce7ad3957496b4c0b">rate</a> == -1)</div><div class="line">      <a class="code" href="getVideoExample_8cpp.html#ad9766129714f3e0c883bbb9879c85be4">rateAsTime</a> = -1;</div><div class="line">    <span class="keywordflow">else</span></div><div class="line">      <a class="code" href="getVideoExample_8cpp.html#ad9766129714f3e0c883bbb9879c85be4">rateAsTime</a> = <a name="a27"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArMath.html#a5cc85672a327b96f1668aaf8efc58c7a">ArMath::roundInt</a>(1000.0 / <a class="code" href="getVideoExample_8cpp.html#a40fc078492fcc08ce7ad3957496b4c0b">rate</a>);</div><div class="line">  }</div><div class="line"></div><div class="line">  <a class="code" href="getVideoExample_8cpp.html#ab2fdc0f1bbbd46b714580926f62fae6e">useCounter</a> = argParser.<a name="a28"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArArgumentParser.html#a08d0d87154763e4869f0342a47059886">checkArgument</a>(<span class="stringliteral">&quot;-counter&quot;</span>);</div><div class="line"></div><div class="line">  <span class="keywordflow">if</span>(!<a name="a29"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classAria.html#a1b090c01d88bb420b8cf8e0384d25ee1">Aria::parseArgs</a>() || !argParser.<a name="a30"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArArgumentParser.html#ac3889cbdfa862031c51bf80e06954914">checkHelpAndWarnUnparsed</a>())</div><div class="line">  {</div><div class="line">    <a name="a31"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classAria.html#a10d71f3d4d0cf7f38c58a1f749f64a42">Aria::logOptions</a>();</div><div class="line">    <a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a012daf6573594f91242f8dd7c02eb74b">ArLog::Terse</a>, <span class="stringliteral">&quot;\n\n%s options:\n-rate &lt;FramesPerSecondAsDouble&gt; (If this isn&#39;t given, then the program will take one frame then exit, note that it is a double (so you can do .5 to do one frame per 2 seconds) and that if you set it to be too fast you&#39;ll saturate the robot&#39;s bandwidth and make it useless)\n-counter (default no)\n&quot;</span>, argv[0]);</div><div class="line"></div><div class="line">    <a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a012daf6573594f91242f8dd7c02eb74b">ArLog::Terse</a>, <span class="stringliteral">&quot;\n\nNotes:\nThis program saves the images as video.jpg if you aren&#39;t using a counter, or video&lt;counter&gt;.jpg if you are using the counter.\nIt puts its logs into getVideoLog.txt, and overwrites it whenever it runs\n&quot;</span>);</div><div class="line">    </div><div class="line">    <span class="keywordflow">return</span> 1;</div><div class="line">  }</div><div class="line">  </div><div class="line"></div><div class="line"></div><div class="line">  <a name="_a32"></a><a class="code" href="classArClientBase.html">ArClientBase</a> <a name="a33"></a><a class="code" href="changeMapOnServer_8cpp.html#afe594bfb305907ae82f259409cc214cb">client</a>;</div><div class="line">  <span class="keywordflow">if</span> (!clientConnector.<a name="a34"></a><a class="code" href="classArClientSimpleConnector.html#af4c6ca707c6c0f039eeb3a2a092a8160">connectClient</a>(&amp;client))</div><div class="line">  {</div><div class="line">    <a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;Could not connect to server, exiting\n&quot;</span>);</div><div class="line">    exit(1);</div><div class="line">  }    </div><div class="line"></div><div class="line">  <a name="_a35"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArGlobalFunctor1.html">ArGlobalFunctor1&lt;ArNetPacket *&gt;</a> jpegHandlerCB(&amp;<a class="code" href="getVideoExample_8cpp.html#ab990e842f67b35df051fd7edddd35888">jpegHandler</a>);</div><div class="line"></div><div class="line">  <span class="keywordflow">if</span>(client.<a name="a36"></a><a class="code" href="classArClientBase.html#a873a731b968b4e3359c60d592122770b">dataExists</a>(<span class="stringliteral">&quot;getPictureCam1&quot;</span>))</div><div class="line">  {</div><div class="line">    <a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;Requesting images using \&quot;getPictureCam1\&quot; request.&quot;</span>);</div><div class="line">    client.<a name="a37"></a><a class="code" href="classArClientBase.html#a57e195371c8ae810b4bbdd1020852aa5">addHandler</a>(<span class="stringliteral">&quot;getPictureCam1&quot;</span>, &amp;jpegHandlerCB);</div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="getVideoExample_8cpp.html#a40fc078492fcc08ce7ad3957496b4c0b">rate</a> != 0 &amp;&amp; <a class="code" href="getVideoExample_8cpp.html#ad9766129714f3e0c883bbb9879c85be4">rateAsTime</a> != 0)</div><div class="line">      client.<a name="a38"></a><a class="code" href="classArClientBase.html#a0a36a40fe2598eb214368ae8c3a26ca1">request</a>(<span class="stringliteral">&quot;getPictureCam1&quot;</span>, <a class="code" href="getVideoExample_8cpp.html#ad9766129714f3e0c883bbb9879c85be4">rateAsTime</a>); </div><div class="line">    <span class="keywordflow">else</span></div><div class="line">      client.<a name="a39"></a><a class="code" href="classArClientBase.html#a2dcd11daf8d2045d460b83733e6932d0">requestOnce</a>(<span class="stringliteral">&quot;getPictureCam1&quot;</span>);</div><div class="line">  } </div><div class="line">  <span class="keywordflow">else</span> <span class="keywordflow">if</span>(client.<a class="code" href="classArClientBase.html#a873a731b968b4e3359c60d592122770b">dataExists</a>(<span class="stringliteral">&quot;sendVideo&quot;</span>))</div><div class="line">  {</div><div class="line">    <a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a7040faf60eeb155eaa85d439b1066ca1">ArLog::Normal</a>, <span class="stringliteral">&quot;Server does not have \&quot;getPictureCam1\&quot; request, requesting images using old \&quot;sendVideo\&quot; request.&quot;</span>);</div><div class="line">    client.<a class="code" href="classArClientBase.html#a57e195371c8ae810b4bbdd1020852aa5">addHandler</a>(<span class="stringliteral">&quot;sendVideo&quot;</span>, &amp;jpegHandlerCB);</div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="getVideoExample_8cpp.html#a40fc078492fcc08ce7ad3957496b4c0b">rate</a> != 0 &amp;&amp; <a class="code" href="getVideoExample_8cpp.html#ad9766129714f3e0c883bbb9879c85be4">rateAsTime</a> != 0)</div><div class="line">      client.<a class="code" href="classArClientBase.html#a0a36a40fe2598eb214368ae8c3a26ca1">request</a>(<span class="stringliteral">&quot;sendVideo&quot;</span>, <a class="code" href="getVideoExample_8cpp.html#ad9766129714f3e0c883bbb9879c85be4">rateAsTime</a>); </div><div class="line">    <span class="keywordflow">else</span></div><div class="line">      client.<a class="code" href="classArClientBase.html#a2dcd11daf8d2045d460b83733e6932d0">requestOnce</a>(<span class="stringliteral">&quot;sendVideo&quot;</span>); </div><div class="line">  }</div><div class="line">  <span class="keywordflow">else</span></div><div class="line">  {</div><div class="line">    <a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#a43a8b3789126c818f390f24bdbceccce">ArLog::log</a>(<a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classArLog.html#ac8cc0fb3aa323ab2a1c21340fdd1dce3a012daf6573594f91242f8dd7c02eb74b">ArLog::Terse</a>, <span class="stringliteral">&quot;Error: Server does not have \&quot;getPictureCam1\&quot; or \&quot;sendVideo\&quot; request, cannot request images.&quot;</span>);</div><div class="line">    <a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classAria.html#a6abc3d39b3e9548063bb8e78375acc17">Aria::exit</a>(2);</div><div class="line">  }</div><div class="line"></div><div class="line"></div><div class="line">  client.<a name="a40"></a><a class="code" href="classArClientBase.html#a012118e5e43ee6e75f9d56ad5fbf2b7b">run</a>();</div><div class="line"></div><div class="line">  <a name="a41"></a><a class="codeRef" doxygen="/home/reed/amrsw/Aria/docs/Aria.tag:../../docs/" href="../../docs/classAria.html#a184602a2b3799d61569ec55dd9508450">Aria::shutdown</a>();</div><div class="line">  <span class="keywordflow">return</span> 0;</div><div class="line">}</div><div class="line"></div><div class="line"></div><div class="line"></div></div><!-- fragment --> </div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
